<template>
	<view class="content">
		<view class="_flex" @click="linkUrl(`/pages/Mine_page/EditUserInfo/index`)">
			<text>修改个人信息</text>
			<u-icon name="arrow-right" color="#888" size="16"></u-icon>
		</view>
		<view class="_flex" @click="show = true">
			<text>退出登录</text>
			<u-icon name="arrow-right" color="#888" size="16"></u-icon>
		</view>
		<u-modal :show="show" :title="title" :closeOnClickOverlay="true" :showCancelButton="true" @confirm="confirm"
			@cancel="show = false">
			<view class="slot-content">
				<rich-text :nodes="content"></rich-text>
			</view>
		</u-modal>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				title: '提示',
				content: '是否退出登录？',
				show: false
			}
		},
		methods: {
			linkUrl(e) {
				uni.navigateTo({
					url: e
				});
			},
			confirm() {
				uni.removeStorageSync('token');
				setTimeout(() => {
					uni.reLaunch({
						url: '/pages/login/login'
					});
				}, 500);
			}
		}
	}
</script>

<style>
	page {
		background-color: #f8f9fa;
	}
</style>
<style scoped lang="less">
	.content {
		width: auto;
		padding: 10rpx 10rpx 0rpx 10rpx;

		._flex {
			width: auto;
			display: flex;
			justify-content: space-between;
			align-items: center;
			padding: 30rpx;
			background-color: #fff;
			border-radius: 10rpx;
			margin-bottom: 5rpx;

			text {
				font-size: 30rpx;
				font-weight: 500;
				letter-spacing: 2rpx;
			}
		}
	}
</style>